import React from 'react';
import { Text, Platform } from 'react-native';
import { List } from 'antd-mobile';
import { Actions } from 'react-native-router-flux';

const Item = List.Item;

export default props => {
  const {
    data,
  } = props;
  const edit = (key) => {
    Actions.drawerClose();
    Actions[key]({ customerId: data.id })
  }
  return (
    <List style={{ paddingTop: Platform.OS === 'ios' ? 44 : 22 }}>
      <Item
        arrow="horizontal"
        onClick={edit.bind(null, 'editCustomerBase')}
      >
        <Text>编辑基础信息</Text>
      </Item>
      <Item
        arrow="horizontal"
        onClick={edit.bind(null, 'editCustomerExtra')}
      >
        <Text>编辑附加信息</Text>
      </Item>
      <Item
        arrow="horizontal"
        onClick={edit.bind(null, 'createFamilyMember')}
      >
        <Text>添加家庭成员</Text>
      </Item>
      <Item
        arrow="horizontal"
        onClick={edit.bind(null, 'createFamilyPolicy')}
      >
        <Text>添加家庭保单</Text>
      </Item>
    </List>
  );
};
